
section	.text

global	_read_cr0

_read_cr0:
	mov	eax,	cr0
	retn

global	_read_cr3

_read_cr3:
	mov	eax,	cr3
	retn

global	_write_cr0

_write_cr0:
	push	ebp
	mov	ebp,	esp
	mov	eax,	[ebp+8]
	mov	cr0,	eax
	pop	ebp
	retn

	
global	_write_cr3

_write_cr3:
	push	ebp
	mov	ebp,	esp
	mov	eax,	[ebp+8]
	mov	cr3,	eax
	pop	ebp
	retn


global _flush_idt
extern __idt_info
	
_flush_idt:
	lidt	[__idt_info]
	retn

global _store_idt
extern idt_tmp
_store_idt:
	sidt	[idt_tmp]
	ret

global _flush_gdt
extern __gdt_info

_flush_gdt:
	lgdt	[__gdt_info]
	jmp	0x08:flush
flush:
	retn

global _store_gdt
extern gdt_tmp
_store_gdt:
	sgdt	[gdt_tmp]
	ret
